package com.bonjour.work.utils.enums;

public enum UserStatus {
	NORMAL(1, "草稿"), 
	FROZEN(2, "已完成");

	private Integer type;
	private String desc;

	UserStatus(Integer type, String desc) {
		this.type = type;
		this.desc = desc;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static String getDesc(Integer type) {

		if (type == null) {
			return NORMAL.desc;
		}

		for (UserStatus statusEnum : UserStatus.values()) {
			if (statusEnum.type == type) {
				return statusEnum.desc;
			}
		}

		return type + "";
	}

}
